package legacy;

import java.util.ArrayList;

public class TestTree
{
 private static int masterIncrement = 0;
 private TestTree parent = null;
 private int score = 0;
 private ArrayList<TestTree> childList = new ArrayList<TestTree>();
 private int uniqueID;
 private int finalScore = 0;
 
 
 public TestTree()
 {
  addToMasterIncrement();
  setUniqueID(getMasterIncrement());
 }
 
 public TestTree(int uniqueID)
 {
  setUniqueID(uniqueID);
 }
 
 public TestTree(TestTree parent)
 {
  this.parent = parent;
  addToMasterIncrement();
  setUniqueID(getMasterIncrement());
 }
 
 
 public void setFinalScore(int finalScore)
 {
  this.finalScore = finalScore;
  return;
 }
 
 
 public int getFinalScore()
 {
  return finalScore;
 }
 
 
 private void addToMasterIncrement()
 {
  masterIncrement++;
  return;
 }
 
 private int getMasterIncrement()
 {
  return masterIncrement;
 }
 
 private void setUniqueID(int newID)
 {
  uniqueID = newID;
  return;
 }
 
 public int getUniqueID()
 {
  return uniqueID;
 }
 
 
 public int getScore()
 {
  return score;
 }
 
 
 public void setScore(int score)
 {
  this.score = score;
  return;
 }
 
 
 public void addChild(TestTree newNode)
 {
  childList.add(newNode);
  return;
 }
 
 
 public TestTree getChild(int pos)
 {
  return childList.get(pos);
 }
 
 
 public ArrayList<TestTree> getChildren()
 {
  return childList;
 }
 
 
 public int getNbChildren()
 {
  return childList.size();
 }
 
 
 public void setParent(TestTree parent)
 {
  this.parent = parent;
  return;
 }
 
 
 public TestTree getParent()
 {
  return parent;
 }
 
 
 public boolean isLeaf()
 {
  boolean isLeaf = false;
  if (childList.size() == 0){isLeaf = true;}
  
  return isLeaf;
 }
 
 
 public boolean isRoot()
 {
  boolean hasParent = true;
  if (parent == null){hasParent = false;}
  
  return hasParent;
 }

}
